#include "Parser.h"

#include <iostream>

using namespace std;

int main(int argc, char** argv)
{
    cout << "hello world!" << endl; 

    const char* str = "dst:(bk,hot),pressed;image:(img:bk1;),(img:pressed1;center:true;);";
    cout << str << endl;
    Parser par1(str);
    for (Parser::Attribute* it1 = par1.First(); it1; it1 = par1.Next()){
        if (0 == strcmp(it1->Name(), "dst")){
            Parser::Value parValue1(it1->Value());
            for (const char* value1 = parValue1.First(); value1; value1 = parValue1.Next()){
                cout << "-------" << endl;
                Parser::Value parValue2(value1);
                for (const char* value2 = parValue2.First(); value2; value2 = parValue2.Next()){
                    cout << "name:" << it1->Name() << " value:" << value2 << endl;
                }
            }
        } else if (0 == strcmp(it1->Name(), "image")){
            Parser::Value parValue1(it1->Value());
            for (const char* value1 = parValue1.First(); value1; value1 = parValue1.Next()){
                cout << "-------" << endl;
                Parser par2(value1);
                for (Parser::Attribute* it2 = par2.First(); it2; it2 = par2.Next()){
                    cout << "name1:" << it1->Name() << " name2 "<< it2->Name() << " value2:" << it2->Value() << endl;
                }
            }
        }
    }

    return 0;
}
